//
//  Common1.m
//  HDGuidePenSystem
//
//  Created by hengdaliuyi on 16/4/20.
//  Copyright © 2016年 hengdawb. All rights reserved.
//

#import "Common1.h"

@implementation Common1
@synthesize currentPeripheral;

DEF_SINGLETON(Common1);

//解码协议
- (void)encodeWithCoder:(NSCoder *)encoder {
    
    [encoder encodeObject:currentPeripheral forKey:@"currentPeripheral"];
    [encoder encodeObject:self.writeCharacteristic forKey:@"writeCharacteristic"];
    [encoder encodeObject:self.readCharacteristic forKey:@"readCharacteristic"];
    
}

//编码协议

- (id)initWithCoder:(NSCoder *)decoder {
    
    currentPeripheral        = [decoder decodeObjectForKey:@"currentPeripheral"];
    self.writeCharacteristic = [decoder decodeObjectForKey:@"writeCharacteristic"];
    self.readCharacteristic  = [decoder decodeObjectForKey:@"readCharacteristic"];

    return self;
}


@end
